package com.cmpe451.nutty.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "RECIPE")
public class Recipe extends BaseModel {
	private static final long serialVersionUID = 1L;

	@Column(name = "RECIPE_NAME")
	private String recipe_name;

	@Column(name = "RECIPE_OWNER")//username
	private String recipe_owner;

	@Column(name = "PREP_TIME")
	private int prep_time;
	
	@Column(name = "COOK_TIME")
	private int cook_time;
	
	@Column(name="DESCRIPTION")
	private String description;
	
	@Column(name="EASINESS")
	private String easiness;
	
	@Column(name="INGREDIENTS_LIST")
	private String ingredients_list;

	@Column(name="IMAGE_LINK")
	private String image_link;
	
	@Column(name="VIDEO_LINK")
	private String video_link;

	@Column(name="TOTAL_RATING")
	private Long total_rating;
	
	@Column(name="RATING_COUNT")
	private int rating_count;
	
	@Column(name="RATE")
	private Double rate;
	
	@Column(name="COST")
	private Long cost;
	
	@Column(name="KITCHEN_TOOLS")
	private String kitchen_tools;
	
	@Column(name="CALORY")
	private Double calory;
	
	@Column(name="CARBS")
	private Double carbs;
	
	@Column(name="FAT")
	private Double fat;
	
	@Column(name="PROTEIN")
	private Double protein;

	public Double getCalory() {
		return calory;
	}

	public void setCalory(Double calory) {
		this.calory = calory;
	}

	@ManyToMany
	@JoinTable(name = "INGREDIENTS_RECIPE", joinColumns = { @JoinColumn(name = "RECIPE_ID") }, inverseJoinColumns = { @JoinColumn(name = "INGREDIENTS_ID") })
	private Set<Recipe> recipes = new HashSet<Recipe>();

	public String getRecipe_name() {
		return recipe_name;
	}

	public void setRecipe_name(String recipe_name) {
		this.recipe_name = recipe_name;
	}

	public String getRecipe_owner() {
		return recipe_owner;
	}

	public void setRecipe_owner(String recipe_owner) {
		this.recipe_owner = recipe_owner;
	}

	public int getPrep_time() {
		return prep_time;
	}

	public void setPrep_time(int prep_time) {
		this.prep_time = prep_time;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getIngredients_list() {
		return ingredients_list;
	}

	public void setIngredients_list(String ingredients_list) {
		this.ingredients_list = ingredients_list;
	}

	public String getImage_link() {
		return image_link;
	}

	public void setImage_link(String image_link) {
		this.image_link = image_link;
	}

	public String getVideo_link() {
		return video_link;
	}

	public void setVideo_link(String video_link) {
		this.video_link = video_link;
	}

	public Set<Recipe> getRecipes() {
		return recipes;
	}

	public void setRecipes(Set<Recipe> recipes) {
		this.recipes = recipes;
	}

	public Long getTotal_rating() {
		return total_rating;
	}

	public void setTotal_rating(Long total_rating) {
		this.total_rating = total_rating;
	}

	public int getRating_count() {
		return rating_count;
	}

	public void setRating_count(int rating_count) {
		this.rating_count = rating_count;
	}

	public Long getCost() {
		return cost;
	}

	public void setCost(Long cost) {
		this.cost = cost;
	}

	public String getKitchen_tools() {
		return kitchen_tools;
	}

	public void setKitchen_tools(String kitchen_tools) {
		this.kitchen_tools = kitchen_tools;
	}

	public int getCook_time() {
		return cook_time;
	}

	public void setCook_time(int cook_time) {
		this.cook_time = cook_time;
	}

	public String getEasiness() {
		return easiness;
	}

	public void setEasiness(String easiness) {
		this.easiness = easiness;
	}

	public Double getRate() {
		return rate;
	}

	public void setRate(Double rate) {
		this.rate = rate;
	}

	public Double getCarbs() {
		return carbs;
	}

	public void setCarbs(Double carbs) {
		this.carbs = carbs;
	}

	public Double getFat() {
		return fat;
	}

	public void setFat(Double fat) {
		this.fat = fat;
	}

	public Double getProtein() {
		return protein;
	}

	public void setProtein(Double protein) {
		this.protein = protein;
	}
	
}
